{template 'common/header'}
<link href="{MODULE_URL}template/web/css/classlist.css" rel="stylesheet" type="text/css">
    <div class="list_th">
        <div class="td" style=" width:20%;">
            <div class="left_padding">   顾客姓名</div>
        </div>
        <div class="td text-center" style=" width:10%;">联系电话</div>
        <div class="td text-center" style=" width:10%;">预约项目</div>
        <div class="td text-center" style=" width:15%;">预约时间</div>
        <div class="td text-center" style=" width:15%;">预约技师</div>
        <div class="td text-center" style=" width:10%;">服务价格</div>
        <div class="td text-center" style=" width:20%;">
            <div class="list_right text-center">操作</div>
        </div>
        <div class="clear"></div>
    </div>
    {if $book}
    {loop $book $k $o}
    <div class="list_tr link_bk">
            <div class="td text-center" style=" width:20%;">
                {$o['uname']}
                <span style="float: right; color:#999999; margin-left: 5px; font-size: 13px;">[订单ID:{$o['id']}]</span>
                <div class="clear"></div>
            </div>
            <div class="td text-center" style=" width:10%;" >
               {$o['phone']}
            </div>
            <div class="td text-center" style=" width:10%;" >
                {$o['goodsname']}
            </div>      
            <div class="td text-center" style=" width:15%; color: #ff5d38;" >
                {php echo date('Y-m-d H:i',$o['booktime'])}
            </div>
           <div class="td text-center" title="{if $o['address']}{$o[address]}{else}未填写{/if}" style=" width:15%;" >
                {if $o['techname']}{$o[techname]}{else}未填写{/if}
            </div>        
            <div class="td text-center" style=" width:10%;" >
              <input name="price" id="price_{$o['id']}" type="number" class="input_text_default small " maxlength="20" value="{$o['price']}" style=" width: 80%; margin-left: 10%;text-align: center; "/>
            </div>                   
            <div class="td edit text-center" style=" width:20%;">
                <div class="list_right btn">
                    <a class="gray goods_save" style="background-color: #ff5d38;" bid="{$o['id']}">改价</a>
                    <a class="gray delete" did="{$o['id']}">取消</a>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    {/loop}
    {else}  
    {/if}
<div class="list_tr">    
<div class="text-center">
  {php echo $pager;}
</div> 
</div>
<style type="text/css">.right-content{padding: 0;}.hot_1{background-color: red;}</style>
<link rel="stylesheet" href="{MODULE_URL}public/css/Toast.css">
<script src="{MODULE_URL}public/js/Toast.js"></script>  
<script type="text/javascript">
$(document).ready(function(){
    var Maxlevel="1";//最多分类层数 
    //打开子菜单
    $(document).on('click','.J_show',function () {
        var sub_box = $(this).closest(".list_tr").next('.j_smalldiv');
        var level = $(this).attr('level');
        sub_box.is(':visible') ? $(this).removeClass("show") : $(this).addClass("show");
        if (sub_box.length == 0 && level < Maxlevel) {
            get_menu($(this).attr('id'), $(this).closest(".list_tr"), level);
        }
        else {
            sub_box.toggle();
        }

    });
    $(document).on('click','.delete', function () {
              if(!confirm("确定要取消该预约吗！")){                
                   window.event.returnValue=false;
               }else{
                   $.ajax({
                       url:"{php echo $this->createWebUrl('bookdel');}&version_id="+"{$_GPC['version_id']}",
                       data:{did:$(this).attr('did')},
                       dataType:"json",
                       type:"post",
                      success:function(res){
                         if(res.status== 1){
                             mqToast({type:1,context: res.msg}); 
                             setTimeout(function(){
                                window.location.reload(); 
                              },2000);
                            
                             return false;
                         }else{
                             mqToast({type:1,context: res.msg}); 
                             return false;
                         }
                      }
                    })                    
               }        
    });   
     $(document).on('click','.goods_save',function(){
        var _this = $(this);
        var bid = _this.attr('bid');
        var price = $.trim($('#price_'+bid).val());
        $.ajax({
           url:"{php echo $this->createWebUrl('save_bookedit_summary');}&version_id="+"{$_GPC['version_id']}",
           data:{bid:bid,price:price},
           dataType:"json",
           type:"post",
          success:function(res){
            if(res.status=='1'){
                mqToast({type:1,context: res.msg})
                return false;
            }else{
                mqToast({type:1,context: res.msg})
                return false;
            }
          }
        });
     }); 
            
});
</script>
{template 'common/footer'}